package com.chukun.netty.codec.customize;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * @author chukun
 * 初始化服务端的解码器
 */
public class NettyCustomizeServerChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ch.pipeline().addLast(new NettyCustomizeByteToLongDecoder());
        ch.pipeline().addLast(new NettyCustomizeMessageToByteEncoder());
        ch.pipeline().addLast("server handler",new NettyServerHandler());
    }
}
